package com.nidu.demo.tenant.executor.command;

import com.alibaba.cola.dto.Response;
import com.nidu.demo.tenant.gateway.TenantPackageGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * 租户套餐删除命令执行器
 *
 * @author auto
 */
@Component
@RequiredArgsConstructor
public class TenantPackageDeleteCmdExe {

    private final TenantPackageGateway gateway;

    public Response execute(Long id) {
        gateway.deleteById(id);
        return Response.buildSuccess();
    }

    public Response execute(Set<Long> ids) {
        gateway.deleteByIds(ids);
        return Response.buildSuccess();
    }
}
